home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** File: EventLoop.c
- ** Written by: Eric Soldan
- **
- ** Copyright © 1990-1992 Apple Computer, Inc.
- ** All rights reserved.
- */
-
-
-
- /*****************************************************************************/
-
-
-
- #include "App.h" /* Get the application includes/typedefs, etc. */
- #include "App.Common.h" /* Get the stuff in common with rez. */
- #include "App.protos.h" /* Get the prototypes for the application. */
-
-
-
- /*****************************************************************************/
-
-
-
- extern RgnHandle gCursorRgn; /* DTS.Lib..framework global. */
- /* The current cursor region. The initial cursor region is an empty region,
- ** which will cause WaitNextEvent to generate a mouse-moved event, which will
- ** cause us to set the cursor for the first time. */
-
- extern Boolean gQuitApplication; /* DTS.Lib..framework global. */
- /* This is set to false by Initialize. When the user selects Quit
- ** (and does not abort the quit), then this boolean is set true. */
-
-
-
- /*****************************************************************************/
- /*****************************************************************************/
-
-
-
- /* Get events forever, and handle them by calling DoEvent. Get the events by
- ** calling WaitNextEvent. */
-
- #pragma segment Main
- void EventLoop(void)
- {
- EventRecord event;
-
- while (!gQuitApplication) {
- if (!WaitNextEvent(everyEvent, &event, 15, gCursorRgn))
- event.what = nullEvent;
- DoEvent(&event);
- };
- }
-
-
-
- /*****************************************************************************/
-
-
-
- /* •• Called by DTS.Lib..framework. •• */
-
- /* Handle the cursor changes. Most of the work is done by the application
- ** framework. Each window has its own cursor calculation proc, so you
- ** shouldn't have to add any code here. You may wish to do some special
- ** stuff prior to the DoWindowCursor call if you have modeless dialogs. */
-
- #pragma segment Main
- void DoCursor(void)
- {
- DoWindowCursor();
- }
-
-
-
-